package com.mc.algorithm;

import java.util.Scanner;

public class Chorus {
	
	private static int[] people;
	private static int d;
	private static int k;
	private static long max;
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			people = new int[n];
			for(int i=0;i<n;i++	){
				people[i] = sc.nextInt();
			}
			
			k = sc.nextInt();
			d = sc.nextInt();
			max = Integer.MIN_VALUE;
			
			for(int i=0;i<n-k+1;i++){
				select(i+1,1,people[i]);
			}
			System.out.println(max);
		}
	}
	
	public static void select(int start, int num, long result){
		if(num==k){
			if(result>max)
				max = result;
			return;
		}
		int limit = Math.min(start+d, people.length);
		
		for(int i=start;i<limit;i++){
			
			select(i+1,num+1,result*people[i]);
		}
	}
}
